package cn.lyjuan.first.netty.demo._3_netty3.client;

import org.jboss.netty.channel.*;

public class ClientHandler extends SimpleChannelHandler
{
    @Override
    public void messageReceived(ChannelHandlerContext ctx, MessageEvent e) throws Exception
    {
        String msg = (String) e.getMessage();

        System.out.println("client messageReceived: " + msg);
    }

    @Override
    public void exceptionCaught(ChannelHandlerContext ctx, ExceptionEvent e) throws Exception
    {
        System.out.println("client exceptionCaught");
        super.exceptionCaught(ctx, e);
    }

    @Override
    public void channelConnected(ChannelHandlerContext ctx, ChannelStateEvent e) throws Exception
    {
        System.out.println("client channelConnected");
        super.channelConnected(ctx, e);
    }

    @Override
    public void channelDisconnected(ChannelHandlerContext ctx, ChannelStateEvent e) throws Exception
    {
        System.out.println("client channelDisconnected");
        super.channelDisconnected(ctx, e);
    }
}
